55dc3c6ff15e39cd26026c9a2afc7b2010a56559,src/main/java/jas/spawner/legacy/spawner/biome/structure/StructureHandler.java,StructureHandler,readFromConfig,#LivingHandlerRegistry#HashMap#WorldProperties#,87
Before Change
if (!handler.creatureTypeID.equals(CreatureTypeRegistry.NONE)) {
if (spawnEntry.itemWeight > 0 && handler.shouldSpawn) {
JASLog.log().info("Adding SpawnListEntry %s of type %s to StructureKey %s", handler.groupID,
handler.creatureTypeID, structureKey);
structureKeysToSpawnList.put(structureKey, spawnEntry);
} else {
structureKeysToDisabledpawnList.put(structureKey, spawnEntry);
JASLog.log().debug(
Level.INFO,
"Not adding Structure SpawnListEntry of %s to StructureKey %s due to Weight %s or ShouldSpawn %s.",
handler.groupID, structureKey, spawnEntry.itemWeight, handler.shouldSpawn);
}
} else {
JASLog.log().debug(Level.INFO,
After Change
ListMultimap<String, SpawnListEntry> structureKeysToSpawnList = ArrayListMultimap.create();
ListMultimap<String, SpawnListEntry> structureKeysToDisabledpawnList = ArrayListMultimap.create();
JASLog.log().info("Starting to load and configure Structure SpawnListEntry data");
for (String structureKey : structureKeys) {
Collection<SpawnListEntryBuilder> spawnList = readSpawnLists.get(structureKey);
if (spawnList == null) {
spawnList = new ArrayList<SpawnListEntryBuilder>();
for (net.minecraft.world.biome.BiomeGenBase.SpawnListEntry spawnListEntry : interpreter
.getStructureSpawnList(structureKey)) {
@SuppressWarnings("unchecked")
List<LivingHandler> handlers = livingHandlerRegistry.getLivingHandlers(spawnListEntry.entityClass);
if (!handlers.isEmpty()) {
SpawnListEntryBuilder builder = new SpawnListEntryBuilder(handlers.get(0).groupID, structureKey);
builder.setWeight(spawnListEntry.itemWeight).setMinChunkPack(spawnListEntry.minGroupCount)
.setMaxChunkPack(spawnListEntry.maxGroupCount);
spawnList.add(builder);
} else {
JASLog.log().warning(
"Default entity %s that should spawn in structure %s does not appear to belong to an entity group.",
spawnListEntry.entityClass.getSimpleName(), structureKey);
}
}
}
for (SpawnListEntryBuilder spawnBuilder : spawnList) {
SpawnListEntry spawnEntry = spawnBuilder.build();
LivingHandler handler = livingHandlerRegistry.getLivingHandler(spawnBuilder.getLivingGroupId());
if (handler == null) {
JASLog.log().severe("Error loading structure %s. EntityGroup %s doesn not appear to exist.",
structureKey, spawnEntry.livingGroupID);
continue;
}
if (!handler.creatureTypeID.equals(CreatureTypeRegistry.NONE)) {
if (spawnEntry.itemWeight > 0 && handler.shouldSpawn) {
JASLog.log().logSpawnListEntry(handler.groupID, "Structure: " + structureKey, true,
"of type " + handler.creatureTypeID);
structureKeysToSpawnList.put(structureKey, spawnEntry);
} else {
structureKeysToDisabledpawnList.put(structureKey, spawnEntry);
JASLog.log().logSpawnListEntry(
handler.groupID,
"Structure: " + structureKey,
false,
String.format("due to Weight %s or ShouldSpawn %s", spawnEntry.itemWeight,
handler.shouldSpawn));
}
} else {
JASLog.log().debug(Level.INFO,
"Not Generating Structure %s SpawnList entries for %s. CreatureTypeID: %s", structureKey,
handler.groupID, handler.creatureTypeID);
}
}
}
this.structureKeysToSpawnList = ImmutableListMultimap.<String, SpawnListEntry> builder()
.putAll(structureKeysToSpawnList).build();
this.structureKeysToDisabledpawnList = ImmutableListMultimap.<String, SpawnListEntry> builder()
.putAll(structureKeysToDisabledpawnList).build();
JASLog.log().info("Finished loading and configuring Structure SpawnListEntry data");
}
public static File getFile(File configDirectory, String saveName) {